# 固定汇率
EXCHANGE_RATE = 7.0
# 兑换次数计数器
exchange_count = 0

def convert_currency(amount, from_currency):
    if from_currency.upper() == 'USD':
        return amount * EXCHANGE_RATE, 'CNY'
    elif from_currency.upper() == 'CNY':
        return amount / EXCHANGE_RATE, 'USD'
    else:
        print("不支持的货币类型，请输入 'USD' 或 'CNY'。")
        return None, None

def ask_continue():
    while True:
        choice = input("是否继续？(Y/N): ").strip().upper()
        if choice == 'Y':
            return True
        elif choice == 'N':
            return False
        else:
            print("输入无效，请输入 'Y' 或 'N'。")

def ask_rating():
    rating = input("您已经完成了3次兑换，能否给我们一个友好的评分（1-5星）？")
    try:
        rating = int(rating)
        if 1 <= rating <= 5:
            print(f"感谢您的 {rating} 星评分！")
        else:
            print("评分应在1-5星之间。")
    except ValueError:
        print("输入无效，请输入一个1-5之间的整数。")

while True:
    try:
        amount = float(input("请输入金额: "))
        from_currency = input("请输入货币类型 (USD/CNY): ").strip().upper()
        converted_amount, to_currency = convert_currency(amount, from_currency)
        if converted_amount is not None:
            print(f"{amount} {from_currency} 兑换为 {converted_amount:.2f} {to_currency}")
            exchange_count += 1
            if exchange_count == 3:
                ask_rating()
                exchange_count = 0
            if not ask_continue():
                break
    except ValueError:
        print("输入无效，请输入有效的数字金额。")
